package com.qymerge.manage.system.dao;

import com.qymerge.manage.core.bean.PageRequest;
import com.qymerge.manage.system.dto.SysUserSnapDTO;
import com.qymerge.manage.system.ro.SysUserRO;

import java.util.List;

/**
 *<p>Title: ISysUserDao</p>
 *<p>Description: 用户</p>
 *
 *@Author cong.zhang
 *@Version 1.0.0
 *@Date 2020/7/26/0026
 *@Time 23:01
 */
public interface ISysUserDao {

    List<SysUserRO> list( SysUserRO user,PageRequest pageRequest);

    int total(SysUserRO user);

    boolean ifExistsId(Long uid);

    boolean ifExistsPhone(String phone);

    SysUserRO findOneById(Long uid);

    SysUserRO findOneByUsername(String username);

    SysUserRO checkPassword(Long uid,String password);

    SysUserRO findOneByPhoneAndPassword(String phone,String password);

    SysUserRO findOneByUsernameAndPassword(String username, String password);

    int install(SysUserRO user);

    int update(SysUserRO user);

    int updatePwd( Long uid,  String password);

    int remove( Long... array);

    int removeList( List<Long> list);

    List<SysUserRO> findAllByRoleId( Long roleId);

    List<SysUserSnapDTO> findAllByRoleName( String roleName);

    List<SysUserRO> findAllByCnName( List<String> list);

    int updateStatus(Long uid, int status);

    int updateUserLoginCountZero(Long id);

    int updateUserLoginCount(Long id);

    SysUserRO findOneByPhone(String phone);

}
